<?php
/**
 * Flash messenger plugin. Automatically assigns the view variable "flashMessages"
 * if messages exist. It is left to the developer to display said message.
 *
 * @uses Zend_Controller_Plugin_Abstract
 */
class Core_Controller_Plugin_FlashMessage extends Zend_Controller_Plugin_Abstract
{
	/**
	 * Before we startup, pull the
	 *
	 * @param  Zend_Controller_Request_Abstract $request
	 * @return void
	 */
	public function preDispatch()
	{
		$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
		$flashMessenger = Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger');
		 
		$viewRenderer->view->assign('flashMessages',$flashMessenger->getMessages());
	}
}